<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 


/*
 CI Library Ip2Country
 Written by: Ciprian Dimofte - 01-01-2010
 */
class Ip2country{
    public $ip;
    public $CI;
    
    public function __construct(){
        $this->CI =& get_instance();
    }
    public function get_country($ip = FALSE){
    	/*
    	if($ip == FALSE){
            $ip = $this->ip;
    	}
        $countries = $this->CI->db->query("SELECT country2, country FROM ip2country WHERE ipFrom<=INET_ATON('" . $ip . "') AND ipTo>=INET_ATON('" . $ip . "')");
        foreach ($countries->result() as $row){
            $country_code = $row->country2;
        	$country_name = $row->country;
        }
        return array("COUNTRY_CODE"=>$country_code, "COUNTRY"=>$country_name);
        */
    	$out = array("COUNTRY_CODE"=>"RO", "COUNTRY"=>"ROMANIA");
        return $out;
    }
}

?>